package com.hemaapp.yjnh.nettask;

import java.util.HashMap;

import org.json.JSONException;
import org.json.JSONObject;

import xtom.frame.exception.DataParseException;

import com.hemaapp.hm_FrameWork.result.HemaArrayResult;
import com.hemaapp.yjnh.BaseHttpInformation;
import com.hemaapp.yjnh.BaseNetTask;

public class ReplyAddTask extends BaseNetTask {

	public ReplyAddTask(BaseHttpInformation information,
			HashMap<String, String> params) {
		super(information, params);
	}

	public ReplyAddTask(BaseHttpInformation information,
			HashMap<String, String> params, HashMap<String, String> files) {
		super(information, params, files);
	}

	@Override
	public Object parse(JSONObject jsonObject) throws DataParseException {
		return new Result(jsonObject);
	}
	
	private class Result extends HemaArrayResult<String> {

		public Result(JSONObject jsonObject) throws DataParseException {
			super(jsonObject);
		}

		@Override
		public String parse(JSONObject jsonObject) throws DataParseException {
			String reply_id= "";
			if (jsonObject != null) {
				try {
					reply_id = get(jsonObject, "reply_id");
					log_i(toString());
				} catch (JSONException e) {
					throw new DataParseException(e);
				}
			}
			return reply_id;
		}

	}
}
